<template>
  <div id="app">
    <Header></Header>
    <RouterView></RouterView>
    <Footer v-if="$route.meta.show"></Footer>
  </div>
</template>

<script>
import Header from '@/components/header'
import Footer from '@/components/footer'

export default {
  name: 'App',
  components: {
    Header, Footer
  },
  mounted() {
    if (this.$store.state.home.bannerList.length == 0) { //浏览器一刷新会这个值就会变成0
      this.$store.dispatch("categoryList");
    }
    this.$store.dispatch("getBannerList");

  }
}
</script>

<style></style>
